<?php

class Database {
	private $db_connection;

	function __construct(){
		$this->db_connection = mysql_connect("127.0.0.1","root","Fl8exTmysql");
		$this->db_selected = mysql_select_db("amps", $this->db_connection);
	}


	function query($sql) {
		$res = mysql_query($sql, $this->db_connection);
		if(is_bool($res)){
			return $res;
		} else {
			$objCursor = new Cursor();
			$objCursor->initFromDb($res);

			return $objCursor;
		}
	}

	function lastId(){
		return mysql_insert_id($this->db_connection);
	}
};

?>